<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@ page contentType="text/html;charset=UTF-8" %>
<%@page import="com.lmpop.trade.ti_ask.*" %>
<%@page import="com.lmpop.trade.ts_category.*" %>
<%@page import="java.util.*" %>
<html>
  <head>
    
    <title>提问管理</title>
	<link href="/program/admin/index/css/style.css" rel="stylesheet" type="text/css">
	<script type="text/javascript" src="index.js"></script>
</head>

<body>

  <% 
  	String trade_id="";
  	if(request.getParameter("trade_id")!=null) trade_id = request.getParameter("trade_id");
  	Ti_askInfo ti_askInfo = new Ti_askInfo();
  	List list = ti_askInfo.getListByPk(trade_id);
	Hashtable map = new Hashtable();
  	if(list!=null && list.size()>0) map = (Hashtable)list.get(0);
  	
  	String cust_id="",title="",contents="",state_code="",reply="",class_attr="",reply_num="",user_id="",user_name="",in_date="";
  	if(map.get("cust_id")!=null) cust_id = map.get("cust_id").toString();
  	if(map.get("title")!=null) title = map.get("title").toString();
  	if(map.get("contents")!=null) contents = map.get("contents").toString();
  	if(map.get("state_code")!=null) state_code = map.get("state_code").toString();
  	if(map.get("reply")!=null) reply = map.get("reply").toString();
  	if(map.get("class_attr")!=null) class_attr = map.get("class_attr").toString();
  	if(map.get("reply_num")!=null) reply_num = map.get("reply_num").toString();
  	if(map.get("user_id")!=null) user_id = map.get("user_id").toString();
  	if(map.get("user_name")!=null) user_name = map.get("user_name").toString();
  	if(map.get("in_date")!=null) in_date = map.get("in_date").toString();

	Ts_categoryInfo ts_categoryInfo = new Ts_categoryInfo();
	String selecttree = ts_categoryInfo.getCategoryTree("000000000000000","7",class_attr);
	Map catMap  = ts_categoryInfo.getCatClassMap("2");
	StringBuffer output =new StringBuffer();
	if(!class_attr.equals(""))
	{
	   String chIds[] =	class_attr.split("\\|");	
	   for(String chId:chIds)
	   {
			 if(catMap!=null)
			 {
				if(catMap.get(chId)!=null)
				{
				  output.append(catMap.get(chId).toString()+" ");   						  
				}                  
			 
			  }                 
	    }		    
	}
  %>
	
	<h1>修改提问</h1>
	
	<!--
	<table width="100%" align="center" cellpadding="0" cellspacing="0" class="dl_so">
        <tr>
          <td width="9%" align="center"><img src="/program/admin/index/images/ban_01.gif" /></td>
          <td width="91%" align="left">
		  <h4>-----------------</h4>
		  <span>1----------------。</span><br/>
		  <span>2----------------。</span>
		  </td>
        </tr>
      </table>
      <br/>
	  -->
	
	
	<form action="/doTradeReg.do" method="post" name="addForm">
	<input name="cust_id" id="cust_id" value="<%=cust_id %>" type="hidden" />
	<input name="user_id" id="user_id"  value="<%=user_id %>" type="hidden" />
	<input name="user_name" id="user_name"  value="<%=user_name %>" type="hidden" /></td>
	<input name="in_date" id="in_date"  value="<%=in_date %>" type="hidden" />
				
	<table width="100%" cellpadding="0" cellspacing="1" border="0" class="listtab">
		
		<tr>
			<td align="right" width="10%">
				标题<font color="red">*</font>
			</td>
			<td colspan="3"><input name="title" id="title" size="50" maxlength="50" value="<%=title %>" type="text" /></td>
		</tr>
		
		
		
		<tr>
			<td align="right" width="10%">
				状态:
			</td>
			<td>
			<select name="state_code" id="state_code">
						<option value="">请选择</option>	
						<option value="c" <%if(state_code.equals("c")) out.print("selected");%>>正常</option>
						<option value="d" <%if(state_code.equals("d")) out.print("selected");%>>禁用</option>
			      </select>
				  </td>
		   <td align="right" width="10%">
				是否回复：
			</td>
			<td><input name="reply" id="reply"  value="0" type="radio" <%if(reply.equals("0")) out.print("checked ");%> />未回复
			<input name="reply" id="reply"  value="1" type="radio" <%if(reply.equals("1")) out.print("checked ");%>/>已回复</td>
		
		</tr>
		
		<tr>
			<td align="right" width="10%">
				类型:
			</td>
			<td align="left" >
			   <input name="class_attr" id="class_attr" value="<%=class_attr %>" type="hidden" />
			    <input type="hidden" id="flag_code" name="flag_code" value="0" />
			
				
			    <select name="class_attr" id="class_attr">
					  <option value="">请选择...</option>
					  <%=selecttree%>
				</select>
								
			</td>
			<td align="right" width="10%">
				回答数量:
			</td>
			<td><input name="reply_num" id="reply_num" size="20" maxlength="20" value="<%=reply_num %>" type="text" /></td>
		
		</tr>
		<tr>
			<td align="right" width="10%">
				问题内容：<font color="red">*</font>
			</td>
			<td colspan="3">
			<textarea name="contents" id="contents"  rows="8" cols="60"  /><%=contents%></textarea></td>
		</tr>
	</table>
	
	<table width="100%" cellpadding="0" cellspacing="0" border="0">
		<tr>
			<td align="center">
			   <input type="hidden" name="bpm_id" value="0895" />
	  			<input type="hidden" name="trade_id" value="<%=trade_id %>" />
				<input type="submit" class="buttoncss" name="tradeSub" value="提交" onclick="return checkSub();"/>&nbsp;&nbsp;
				<input type="button" class="buttoncss" name="tradeRut" value="返回" onclick="window.location.href='index.jsp';"/>
			</td>
		</tr>
	</table>
	</form>
</body>

</html>
